function cut(string, from, end)
{
	if (string == "")
	{
		return string;
	}

	f_index = string.indexOf(from);
	e_index = string.indexOf(end);
	
	if (f_index == -1)
	{
		f_index = 0;
	}
	else
	{
		f_index += from.length;
	}

	if (e_index == -1)
	{
		e_index = string.length;
	}

	return string.substring(f_index, e_index);
}

function reg_match(string, reg)
{
	var array = reg.exec(string);
	if (array && array[1])
	{
		return array[1];
	}
	else
	{
		return "";
	}
}

function system(command, windowstyle, waitonreturn)
{
	var shell = WScript.CreateObject("WScript.Shell");

	if (windowstyle == null)
	{
		windowstyle = 1;
	}

	if (waitonreturn == null)
	{
		waitonreturn = true;
	}
	

	shell.run(command, windowstyle, waitonreturn);
}

function hash()
{
	var id = "";
	var hash = new Array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z");

	for (loop = 0; loop < 10; loop++)
	{
		rnd = Math.floor(Math.random() * hash.length);
		id = id + hash[rnd];
	}

	return id;
}
